import request from '../utils/request';
import vue from 'vue';
import { Upload, Progress } from 'element-ui';

vue.use(Upload)
vue.use(Progress)

export const getAllItemNews = query => {
    query.url ="/manager/video/videoItemList?id="+ query.id;
    return request({
        url: query.url,
        method: 'get',
        data: query.data
    });
};


export const getAllNews = query => {
    return request({
        url: query.url,
        method: 'post',
        data: query.data
    });
};

export const delNews = query => {
    query.url ="/manager/video/delVideoById?id="+ query.id;
    return request({
        url: query.url,
        method: 'get',
        params: query.data
    });
};

export const delNewsItem = query => {
    query.url ="/manager/video/delVideoItem?id="+ query.id;
    return request({
        url: query.url,
        method: 'get',
        params: query.data
    });
};


export const saveNews = query => {
    return request({
        url: query.url,
        method: 'post',
        data: query.data
    });
};

export const saveItemNews = query => {
    return request({
        url: query.url,
        method: 'post',
        data: query.data
    });
};

export const saveStatus = query => {
    return request({
        url: query.url,
        method: 'post',
        data: query.data
    });
};

export const editNews = query => {
    return request({
        url: query.url,
        method: 'post',
        data: query.data
    });
};

export const editItemNews = query => {
    return request({
        url: query.url,
        method: 'post',
        data: query.data
    });
};

export const getDetail = query => {
    query.url ="/manager/video/getVideoInfo?id="+ query.id;
    return request({
        url: query.url,
        method: 'get',
        params: query.data
    });
};

export const getVodSignatureUrl = query => {
    query.url ="/manager/video/getSignUrl";
    return request({
        url: query.url,
        method: 'get',
        params: query.data
    });
};

export const getDetailItem = query => {
    query.url ="/manager/video/videoItemInfo?id="+ query.id;
    return request({
        url: query.url,
        method: 'get',
        params: query.data
    });
};
